<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>input</title>
</head>
<body>
  <h1>请输入数字</h1>
  <input type="number" min="1" max="10">
  <h2>结果：</h2>
</body>
<style>
  body {
    background: #b7472a;
    color: #fff2e5;
  }

  input {
    font-size: 3em;
    width: 200px;
    height: 50px;
    border-radius: 10px;
  }
  
  /* 伪类可以有多个 */
  input:out-of-range:focus {
    background-color: gold;
  }

  /* 而伪元素只能有一个 */
  input:out-of-range + h2::after {
    content: 'Out of range';
  }
</style>
</html>